
<% unless target.articles.empty? %>
    <div id="articles">
      <ul class="thumbnails" style="list-style: none;">
        <% target.articles.each do |article| %>
          <li class="col-md-3">
            <div class="thumbnail">
              <%= image_tag(article.picture.url) %>
              <div class="caption" align="center">
                <h3><strong><%= article.name %></strong></h3>
                <h4>$ <%= article.prize %></h4>
                <p align="left"><%= article.description %></p>
              </div>
              <div class="row article-actions" align="center">


                <%#= link_to(comprar_path(:article_id => article.id.to_s), :class => "btn btn-mini pull-right") do %>
                 Comprar
                <%# end %>


              </div>
              <% if user_signed_in? %>
                <hr>
                <div class="row article-actions" align="center">
                  <%= link_to edit_article_path(article.id) do%>
                    <button class="btn btn-mini btn-default">
                      <span class="glyphicon glyphicon-pencil"></span> Editar  
                    </button>
                    <% end %>
                  <%= link_to 'Eliminar', article, method: :delete, data: { confirm: 'Are you sure?' }, :class => 'btn btn-mini btn-danger' %>
                </div>
              <% end %>
            </div>
          </li>
        <% end %>
      </ul>
    </div>
<% else %>
  <h4>No hay artículos en esta categoría. </h4>
<% end %>
<% if user_signed_in? %>
  <%= link_to "Nuevo artículo", new_article_path %>
<%end%>